package petrochina.company.electric.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.Objects;

/**
 * 任务申请线路数据
 */
public class TaskFillUserData {

    // id
    private long id;
    private long stationId;
    private String userName;
    private int status;
    private int averageDegree;
    private String createTime;
    private boolean isWrite = false;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getStationId() {
        return stationId;
    }

    public void setStationId(long stationId) {
        this.stationId = stationId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getAverageDegree() {
        return averageDegree;
    }

    public void setAverageDegree(int averageDegree) {
        this.averageDegree = averageDegree;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

//    public static Creator<TaskFillUserData> getCREATOR() {
//        return CREATOR;
//    }

    public boolean isWrite() {
        return isWrite;
    }

    public void setWrite(boolean write) {
        isWrite = write;
    }

//    @Override
//    public int describeContents() {
//        return 0;
//    }
//
//    @Override
//    public void writeToParcel(Parcel dest, int flags) {
//        dest.writeLong(this.id);
//        dest.writeLong(this.stationId);
//        dest.writeString(this.userName);
//        dest.writeInt(this.status);
//        dest.writeInt(this.averageDegree);
//        dest.writeString(this.createTime);
//    }
//
//    public void readFromParcel(Parcel source) {
//        this.id = source.readLong();
//        this.stationId = source.readLong();
//        this.userName = source.readString();
//        this.status = source.readInt();
//        this.averageDegree = source.readInt();
//        this.createTime = source.readString();
//    }

    public TaskFillUserData(long id, long stationId, String userName, int status, int averageDegree, String createTime) {
        this.id = id;
        this.stationId = stationId;
        this.userName = userName;
        this.status = status;
        this.averageDegree = averageDegree;
        this.createTime = createTime;
    }

    protected TaskFillUserData(Parcel in) {
        this.id = in.readLong();
        this.stationId = in.readLong();
        this.userName = in.readString();
        this.status = in.readInt();
        this.averageDegree = in.readInt();
        this.createTime = in.readString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof TaskFillUserData)) return false;
        TaskFillUserData that = (TaskFillUserData) o;
        return getId() == that.getId();
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId(), getStationId(), getUserName(), getStatus(), getAverageDegree(), getCreateTime());
    }

//    public static final Creator<TaskFillUserData> CREATOR = new Creator<TaskFillUserData>() {
//        @Override
//        public TaskFillUserData createFromParcel(Parcel source) {
//            return new TaskFillUserData(source);
//        }
//
//        @Override
//        public TaskFillUserData[] newArray(int size) {
//            return new TaskFillUserData[size];
//        }
//    };
}
